#include "hardware.h"

// Initialise the hardware
void appInitHardware(void) {
	initHardware();


}
// Initialise the software
TICK_COUNT appInitSoftware(TICK_COUNT loopStart){
	return 0;
}
// This is the main loop
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) {

	// -------- Start Switch/Button-------
	// Switch/Button - see switch.h
	
	// To test if it is pressed then
	if(SWITCH_pressed(&button)){
		// pressed
	}
	
	// To test if it is released then
	if(SWITCH_released(&button)){
		// released
	}
	// -------- End   Switch/Button-------

	// -------- Start Sharp GP2-------
	// Read the Sharp GP2 and store the result in Top.distance.cm
	distanceRead(Top);
	
	// The value can be printed using %u eg rprintf("Distance=%u",Top.distance.cm);
	// or dumped using:
	rprintf("Top: ");
	distanceDump(Top);
	rprintfCRLF();
	// -------- End   Sharp GP2-------

	return 0;
}
